package com.xnx3.banmahuishou.core.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.xnx3.j2ee.entity.BaseEntity;

/**
 * 代理商信息表
 * @author 王晓龙
 */
@Entity()
@Table(name = "laji_agency")
public class Agency extends BaseEntity implements java.io.Serializable {
	/**
	 * 代理商状态 1正常
	 */
	public static final Short STATE_NORMAL = 1;
	/**
	 * 代理商状态 2冻结
	 */
	public static final Short STATE_FROZEN = 2;
	
	private Integer id;	//自增id
	private String name;	//代理商名字，公司名字，也或者个人名字
	private String phone;	//代理的联系电话
	private Integer userid;	//这个代理商属于哪个用户，对应user.id
	private String address;	//办公地址
	private Integer version;	//乐观锁
	private Integer parentId;	//推荐人id，父级代理的agency.id。若父级代理是总管理，则为0
	private Integer addtime;	//开通时间，10位时间戳
	private Integer expiretime;	//到期时间。10位时间戳，预留字段，第一期没用到
	private Short state;	//代理状态，1正常；2冻结
	private Integer money;	//账户余额，这个代理商的余额，单位是分，预留字段，一期没用到
	private String addminArea;	//这个是代理商所管理的区域，单纯在后台展示用的,没有什么其他业务逻辑使用。 格式如: 省代理- 山东省,  单个市代理-山东省潍坊市 , 多个市代理- 山东省潍坊市,青岛市, 单个区代理- 山东省潍坊市寒亭区,  多个区代理- 山东省潍坊市寒亭区,奎文区
	private String contactName;	//联系人姓名，如 管雷鸣
	private String email;	//联系邮箱
	private String sheng;	//代理商管辖区域--省,最多只允许选择一个省
	private String shi;	//代理商管辖区域--市,可选择省下的多个市,多个以英文,分割
	private String qu;	//代理商管辖区域--区,可选择市下的多个区,多个以英文,分割
	private String shengCode;	//省对应的区划代码,格式:["370000"], 默认[]
	private String shiCode;	//市对应的区划代码,格式:["370700","370300"], 默认[]
	private String quCode;	//区对应的区划代码,格式:["370703","370704","370705"], 默认[]
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "name", columnDefinition="char(38) COLLATE utf8_unicode_ci COMMENT '代理商名字，公司名字，也或者个人名字' default ''")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "phone", columnDefinition="char(20) COLLATE utf8_unicode_ci COMMENT '代理的联系电话' default ''")
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	@Column(name = "userid", columnDefinition="int(11) COMMENT '这个代理商属于哪个用户，对应user.id' default '0'")
	public Integer getUserid() {
		return userid;
	}
	public void setUserid(Integer userid) {
		this.userid = userid;
	}
	@Column(name = "address", columnDefinition="char(150) COLLATE utf8_unicode_ci COMMENT '办公地址' default ''")
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	@Column(name = "version", columnDefinition="int(11) COMMENT '乐观锁' default '0'")
	public Integer getVersion() {
		return version;
	}
	public void setVersion(Integer version) {
		this.version = version;
	}
	@Column(name = "parent_id", columnDefinition="int(11) COMMENT '推荐人id，父级代理的agency.id。若父级代理是总管理，则为0 '0'")
	public Integer getParentId() {
		return parentId;
	}
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}
	@Column(name = "addtime", columnDefinition="int(11) COMMENT '开通时间，10位时间戳'0'")
	public Integer getAddtime() {
		return addtime;
	}
	public void setAddtime(Integer addtime) {
		this.addtime = addtime;
	}
	@Column(name = "expiretime", columnDefinition="int(11) COMMENT '到期时间。10位时间戳，预留字段，第一期没用到'0'")
	public Integer getExpiretime() {
		return expiretime;
	}
	public void setExpiretime(Integer expiretime) {
		this.expiretime = expiretime;
	}
	@Column(name = "state", columnDefinition="tinyint(2) COMMENT '代理状态，1正常；2冻结'0'")
	public Short getState() {
		return state;
	}
	public void setState(Short state) {
		this.state = state;
	}
	@Column(name = "money", columnDefinition="int(11) COMMENT '账户余额，这个代理商的余额，单位是分，预留字段，一期没用到'0'")
	public Integer getMoney() {
		return money;
	}
	public void setMoney(Integer money) {
		this.money = money;
	}
	@Column(name = "admin_area", columnDefinition="char(255) COLLATE utf8_unicode_ci COMMENT '这个是代理商所管理的区域，单纯在后台展示用的,没有什么其他业务逻辑使用。 格式如: 省代理- 山东省,  单个市代理-山东省潍坊市 , 多个市代理- 山东省潍坊市,青岛市, 单个区代理- 山东省潍坊市寒亭区,  多个区代理- 山东省潍坊市寒亭区,奎文区' default ''")
	public String getAddminArea() {
		return addminArea;
	}
	public void setAddminArea(String addminArea) {
		this.addminArea = addminArea;
	}
	@Column(name = "contact_name", columnDefinition="char(20) COLLATE utf8_unicode_ci COMMENT '联系人姓名，如 管雷鸣' default ''")
	public String getContactName() {
		return contactName;
	}
	public void setContactName(String contactName) {
		this.contactName = contactName;
	}
	@Column(name = "email", columnDefinition="char(30) COLLATE utf8_unicode_ci COMMENT '联系邮箱' default ''")
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	@Column(name = "sheng", columnDefinition="char(30) COLLATE utf8_unicode_ci COMMENT '代理商管辖区域--省,最多只允许选择一个省' default ''")
	public String getSheng() {
		return sheng;
	}
	public void setSheng(String sheng) {
		this.sheng = sheng;
	}
	@Column(name = "shi", columnDefinition="char(255) COLLATE utf8_unicode_ci COMMENT '代理商管辖区域--市,可选择省下的多个市,多个以英文,分割' default ''")
	public String getShi() {
		return shi;
	}
	public void setShi(String shi) {
		this.shi = shi;
	}
	@Column(name = "qu", columnDefinition="char(255) COLLATE utf8_unicode_ci COMMENT '代理商管辖区域--区,可选择市下的多个区,多个以英文,分割' default ''")
	public String getQu() {
		return qu;
	}
	public void setQu(String qu) {
		this.qu = qu;
	}
	@Column(name = "sheng_code", columnDefinition="char(30) COLLATE utf8_unicode_ci COMMENT '省对应的区划代码,格式:[\"370000\"], 默认[]' default ''")
	public String getShengCode() {
		return shengCode;
	}
	public void setShengCode(String shengCode) {
		this.shengCode = shengCode;
	}
	@Column(name = "shi_code", columnDefinition="char(255) COLLATE utf8_unicode_ci COMMENT '市对应的区划代码,格式:[\"370700\",\"370300\"], 默认[]' default ''")
	public String getShiCode() {
		return shiCode;
	}
	public void setShiCode(String shiCode) {
		this.shiCode = shiCode;
	}
	@Column(name = "qu_code", columnDefinition="char(255) COLLATE utf8_unicode_ci COMMENT '区对应的区划代码,格式:[\"370703\",\"370704\",\"370705\"], 默认[]' default ''")
	public String getQuCode() {
		return quCode;
	}
	public void setQuCode(String quCode) {
		this.quCode = quCode;
	}
	@Override
	public String toString() {
		return "Agency [id=" + id + ", name=" + name + ", phone=" + phone + ", userid=" + userid + ", address="
				+ address + ", version=" + version + ", parentId=" + parentId + ", addtime=" + addtime + ", expiretime="
				+ expiretime + ", state=" + state + ", money=" + money + ", addminArea=" + addminArea + ", contactName="
				+ contactName + ", email=" + email + ", sheng=" + sheng + ", shi=" + shi + ", qu=" + qu + ", shengCode="
				+ shengCode + ", shiCode=" + shiCode + ", quCode=" + quCode + "]";
	}
	
}
